laravel foreach loop index from 1

55

loop index foreach laravel -

@foreach ($teams as $key => $team)
{{ str_ordinal($key + 1) }}
@endforeach

laravel foreach loop index from 1 -

@foreach($items as $item)
$loop->iteration
@endforeach

Comments

Submit
0 Comments